import 'package:elmer_tools/context/AppContext.dart';
import 'package:elmer_tools/service/ApiService.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class AppProvider extends StatelessWidget {
    final Widget child;
    final dynamic contextData;
    final ApiService apiService;
    
    
    const AppProvider({
        super.key,
        required this.child,
        required this.apiService,
        this.contextData,
    });
    
    @override
    Widget build(BuildContext context) {
        return MultiProvider(
            providers: [
                ChangeNotifierProvider(create: (_) => AppContext(api: apiService)),
            ],
            child: child,
        );
    }
}